package com.funwell.modules.controller.response.user;

import com.funwell.modules.model.user.User;
import io.swagger.annotations.ApiModel;
import org.springframework.beans.BeanUtils;

import javax.persistence.Transient;

@ApiModel(description = "用户信息")
public class UserResponseBean {
	
	
	private String id;

	private String loginName;
	
	private String name;

	private String password;

	


	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id == null ? null : id.trim();
	}

	

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password == null ? null : password.trim();
	}

	
	
	/**
	 * 登录token
	 */
	@Transient
	private String accessToken;

	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}
    
	/**
	 * @param user
	 * @return
	 */
	public static UserResponseBean clone(User user) {
		if (user == null) {
			return null;
		}
		UserResponseBean bean = new UserResponseBean();
		BeanUtils.copyProperties(user, bean);
		return bean;
	}

}